package org.example.lotterysystem.service.dto;

import lombok.Data;
import lombok.Getter;
import org.example.lotterysystem.service.enmus.ActivityPrizeStatusEnum;
import org.example.lotterysystem.service.enmus.ActivityPrizeTiersEnum;
import org.example.lotterysystem.service.enmus.ActivityStatusEnum;
import org.example.lotterysystem.service.enmus.ActivityUserStatusEnum;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ActivityDetailDTO {

    //活动信息
    /**
     * 活动id
     */
    private Long activityId;
    /**
     * 活动名称
     */
    private String activityName;
    /**
     * 活动描述
     */
    private String desc;
    /**
     * 活动状态
     */
    private ActivityStatusEnum status;

    public Boolean valid(){
        return status.equals(ActivityStatusEnum.RUNNING);
    }

    //奖品信息
    private List<PrizeDTO> prizeDTOList;

    //人员信息

    private List<UserDTO> userDTOList;

    @Data
    public static class PrizeDTO{
        /**
         * 奖品Id
         */
        private Long prizeId;
        /**
         * 奖品名
         */
        private String name;

        /**
         * 图片索引
         */
        private String imageUrl;

        /**
         * 价格
         */
        private BigDecimal price;

        /**
         * 描述
         */
        private String description;
        /**
         * 奖品等级
         */
        private ActivityPrizeTiersEnum tiers;

        private Long prizeAmount;

        private ActivityPrizeStatusEnum status;
        public Boolean valid(){
            return ActivityPrizeStatusEnum.INIT.equals(status);
        }

    }

    @Data
    public static class UserDTO{
        /**
         * 人员id
         */
        private Long userId;
        /**
         * 人员姓名
         */
        private String userName;
        /**
         *
         * 人员状态
         */
        private ActivityUserStatusEnum status;
        public Boolean valid(){
            return ActivityUserStatusEnum.INIT.equals(status);
        }
    }

}
